Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a 'Connections' property #110

Merged
merged 6 commits into from
Feb 27, 2024
Merged

Add a 'Connections' property #110

merged 6 commits into from
Feb 27, 2024

Conversation

biotic21
Copy link
Contributor

@biotic21 biotic21 commented Dec 21, 2022

Add a new property to display the number of peers connected, including inbound and outbound.

Code not tested, so creating a draft PR as requested here.

@chrisguida
Copy link
Contributor

Thanks for the PR! Let us know where you're getting stuck testing and we'll get you sorted out :)

@kn0wmad
Copy link
Contributor

kn0wmad commented Jun 26, 2023

Add a new property to display the number of peers connected, including inbound and outbound.

Code not tested, so creating a draft PR as requested here.

Have you had a chance to test this?

@biotic21
Copy link
Contributor Author

I apologize for the very long delay on this. I wasn't originally intending to build or test, as I had no experience with any of this... including Rust, Docker, Make, Typescript, and on and on. I only created the draft PR after being requested to.

Anyway, I finally got the motivation to learn and was able to spin up an Ubuntu server on a VM to build the .s9pk and then load it onto a StartOS VM. The new property worked as expected! I've attached a screenshot below showing the property value in the Web UI compared to running the bitcoin-cli getnetworkinfo command in the service's container.

The only change I had to make was to the root project's Makefile (unrelated to this PR):

  1. Replaced all instances of embassy-cli and embassy-sdk with start-cli and start-sdk.
  2. Replaced both instances of ~/.embassy/config.yaml with ./start9/config.yaml. I don't know if this one made any difference, since it didn't affect me working through the hello-world-startos demo. But I did inspect electrs-startos to see how services made RPC calls to the Bitcoin Core service and noticed that this file was moved.

Outbound and Inbound

@kn0wmad
Copy link
Contributor

kn0wmad commented Dec 13, 2023

This looks awesome, is it ready for review? Happy to test

@biotic21 biotic21 marked this pull request as ready for review December 13, 2023 16:52
@biotic21
Copy link
Contributor Author

Marked as ready for review. This is my first PR (ever), so feel free to change anything or let me know what I should change or do differently in the future.

@kn0wmad
Copy link
Contributor

kn0wmad commented Jan 17, 2024

Sorry for the delay - I'm testing this and I don't see the Connections Property at all. Is it possible you forgot to commit something? Master will also need to be merged in. I also see your screenshot shows 0.0GiB disk usage, which is surely wrong.

image

@biotic21
Copy link
Contributor Author

Thanks for trying this out and sorry that there was an issue. I've merged the latest from the Start9Lab:master to my property-test branch, rebuilt with make, and retested by sideloading the bitcoind.s9pk package file to update the Bitcoin Core service. I can see the Connections property, and I've confirmed that what is in my property-test branch is exactly what I built and tested. (Before, as I noted, I didn't commit some simple changes in the Makefile to update embassy-cli and embassy-sdk to start-cli and start-sdk, just to get make to work. Perhaps this was the problem.)

Btw, the 0.0GiB disk usage is because I sideloaded the .s9pk package file I created onto a VM with a freshly installed StartOS. I did not update a Bitcoin Core service on an existing StartOS machine. So it was still syncing headers in the VM when I took that screenshot. I forced the inbound connection by adding the VM node's peer address to my main bitcoin node.

Makefile Outdated Show resolved Hide resolved
Copy link
Contributor

@kn0wmad kn0wmad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested good for me - I'll let @dr-bonez take a look for merge

install:
ifeq (,$(wildcard ~/.embassy/config.yaml))
@echo; echo "You must define \"host: http://server-name.local\" in ~/.embassy/config.yaml config file first"; echo
install: $(PKG_ID).s9pk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong - it will force universal package build on each install making arm and x86 targets useless

ifeq (,$(wildcard ~/.embassy/config.yaml))
@echo; echo "You must define \"host: http://server-name.local\" in ~/.embassy/config.yaml config file first"; echo
install: $(PKG_ID).s9pk
ifeq (,$(wildcard ./start9/config.yaml))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are searching for the start-sdk config file that resides (by default) in users home directory and has host defined for easy installation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dr-bonez take a look at it please

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed main.rs looks good to my eye. Good catch on the Makefile

Copy link
Collaborator

@Dominion5254 Dominion5254 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't built and tested, but the code looks good.

@kn0wmad
Copy link
Contributor

kn0wmad commented Feb 27, 2024

Merging and manually fixing the Makefile issue as @biotic21 has become unresponsive. PR inbound

@kn0wmad kn0wmad merged commit d545f0a into Start9Labs:master Feb 27, 2024
1 check passed
@biotic21 biotic21 deleted the property-test branch February 28, 2024 05:50
@biotic21
Copy link
Contributor Author

Thank you all for the help getting this completed!

Sorry that I didn't realize you were waiting for me to respond to something. I'm not sure I'm knowledgeable enough about the ins and outs of the Makefile anyway to be of much help. But thanks again!

@kn0wmad
Copy link
Contributor

kn0wmad commented Feb 28, 2024

No worries, we dropped the ball for a while as well. Thank you very much for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants